﻿using System;
using System.Collections.Generic;
using System.Text;
using FFIV.Lib.IView.Users;
using FFIV.Lib.BusinessRules;
using System.Web.Security;
using FFIV.Lib.Utilities;

namespace FFIV.Lib.Controlers.Admin
{
	public class EditUserInfoController
	{
		private IEditUserInfo m_View;

		public EditUserInfoController(IEditUserInfo View)
		{
			m_View = View;
		}

		public void LoadPage()
		{
			m_View.Email = UsersUtility.GetCurrentUserEmail();
			m_View.ShowName = UsersUtility.GetCurrentUserName();
		}

		public void FinishEdit()
		{
			UsersUtility.PasswordReset(UsersUtility.GetCurrentUserId(), m_View.Password);
			UsersUtility.ShowNameReset(UsersUtility.GetCurrentUserId(), m_View.ShowName);
		}
	}
}
